Method of detecting moving objects via a moving camera, and related processing system, device and computer-program product

ABSTRACT

In accordance with an embodiment, a method of detecting moving objects via a moving camera includes receiving a sequence of images from the moving camera; determining optical flow data from the sequence of images; decomposing the optical flow data into global motion related motion vectors and local object related motion vectors; calculating global motion parameters from the global motion related motion vectors; calculating moto-compensated vectors from the local object related motion vectors and the calculated global motion parameters; compensating the local object related motion vectors using the calculated global motion parameters; and clustering the compensated local object related motion vectors to generate a list of detected moving objects.

This application claims priority of Italian Patent Application No.102019000001833, filed on Feb. 8, 2019, which application is herebyincorporated herein by reference.

TECHNICAL FIELD

Embodiments of the present disclosure relate to techniques for detectingmoving objects via a moving camera.

BACKGROUND

Independently moving object (IMO) detection is an important motionperception capability of a mobile observatory system. Since the changesin a scene may be due to the motion of the camera (ego-motion) and themotion of objects there are two possibilities for the dynamic nature ofthe camera and world setup concerning IMO detection: Stationary camera,moving objects (SCMO) and moving camera, moving objects (MCMO).

In dynamic scene analysis, SCMO scenes have received the most attention.A variety of methods to detect moving objects in static scenes has beenproposed. There are in general two types of approaches: region based andboundary based. The most popular and recent region-based approaches isbackground subtraction, as described, e.g., in: D. K. Panda and S.Meher. Detection of Moving Objects Using Fuzzy Color DifferenceHistogram Based Background Subtraction. IEEE Signal Processing Letters,2016; M. Anandhalli and V. P. Baligar. Improvised approach usingbackground subtraction for vehicle detection. IEEE International AdvanceComputing Conference (IACC), 2015; O. E. Harrouss, D. Moujahid and H.Tairi. Motion detection based on the combining of the backgroundsubtraction and spatial color information. Intelligent Systems andComputer Vision (ISCV), 2015; and T. Huynh-The, O. Banos, S. Lee, B. H.Kang, E. Kim and T. Le-Tien. NIC: A Robust Background ExtractionAlgorithm for Foreground Detection in Dynamic Scenes. IEEE Transactionson Circuits and Systems for Video Technology, 2016.

Conversely, in boundary-based approaches, many recent approaches useedge based optical flow, as described, e.g., in: C. Huang and M. Hung.Target motion compensation with optical flow clustering during visualtracking. IEEE 11th International Conference on Networking, Sensing andControl (ICNSC), 2014; C. Wong, W. C. Siu, S. Barnes, P. Jennings and B.Fong. Shared-use motion vector algorithm for moving objects detectionfor automobiles. IEEE International Conference on Consumer Electronics(ICCE), 2016; J. Hariyono and K. Jo. Detection of pedestrian crossingroad. IEEE International Conference on Image Processing (ICIP), 2015;and C. Liang and C. Juang. Moving Object Classification Using aCombination of Static Appearance Features and Spatial and TemporalEntropy Values of Optical Flows. IEEE Transactions on IntelligentTransportation Systems, 2015.

Interest for MCMO has been largely increased in computer vision due tothe rising demand for mobile platforms, such as Unmanned Aerial Vehicles(UAVs), automatic vehicles and mobile robots.

For example, FIG. 1 shows a typical MCMO situation. Specifically, in theexample considered, an unmanned aerial vehicle drone (UAV D) flies witha given velocity V_(D) at a given height over a surface S. The UAV Dincludes at least one camera for acquiring images of the surface S. Forexample, in FIG. 1 shows two objects O1 and O2, such as cars, whichtravel on the surface S with respective velocities v1 and v2.

Thus, as shown in FIG. 2, generally the present application relates to amovable device D comprising a camera 10 providing a sequence of imagesIMG and a processing unit 30 configured to determine a list of movingobjects O in the images IMG. Specifically, the displacement of objects Oin the image IMG is derived from two types of movements: the movement ofthe device D/camera 10 (e.g., vD); and the movement of the movingobjects O to be detected (e.g., v1, v2).

MCMO is thus an extremely challenging task in dynamic scene analysis.Due to the difficulty of detecting moving objects with a moving camera10, since the two types of movement are mixed together, only a handfulof methods have been proposed compared to a stationary camera.

One of the key steps in IMO detection in the MCMO case is thus thecompensation of the camera induced motion. A variety of methods tocompensate for the ego-motion has been proposed. In particular, two mainapproaches have been proposed: visual feature based and motion based.

Visual feature-based approaches usually consider colors, corners, edgesor shapes, as described, e.g., in: C. Hsu-Yung, W. Chih-Chia, and C.Yi-Ying, “Vehicle Detection in Aerial Surveillance Using DynamicBayesian Networks”, IEEE Transactions on Image Processing, vol. 21, pp.2152-2159, 2012; C. Long, J. Zhiguo, Y. Junli, and M. Yibing, “Acoarse-to-fine approach for vehicles detection from aerial images”,International Conference on Computer Vision in Remote Sensing (CVRS),2012; S. A. Cheraghi and U. U. Sheikh, “Moving object detection usingimage registration for a moving camera platform”, IEEE InternationalConference on Control System, Computing and Engineering (ICCSCE), 2012;J. Gleason, A. V. Nefian, X. Bouyssounousse, T. Fong, and G. Bebis,“Vehicle detection from aerial imagery”, IEEE International Conferenceon Robotics and Automation, 2011; Z. Zezhong, W. Xiaoting, Z. Guoqing,and J. Ling, “Vehicle detection based on morphology from highway aerialimages”, IEEE International Geoscience and Remote Sensing Symposium(IGARSS), 2012; A. Kembhavi, D. Harwood, and L. S. Davis, “VehicleDetection Using Partial Least Squares”, IEEE Transactions on PatternAnalysis and Machine Intelligence, vol. 33, pp. 1250-1265, 2011; and P.Sadeghi-Tehran and P. Angelov, “ATDT: Autonomous Template basedDetection and Tracking of Objects from Airborne Camera”, Proceedings ofIEEE International Intelligent Systems, pp 555-565, 2014. However, theinventors have observed that these approaches are not computationallyefficient, since image information is needed for the processing.

An alternative method is based on motion analysis. Specifically,different motion based MCMO approaches have been proposed:spatio-temporal background modeling, grid-based modeling and featureclustering, as described, e.g., in: S. W. Kim, K. Yun, K. M. Yi, S. J.Kim and J. Y. Choi, “Detection of moving objects with a moving camerausing non-panoramic background model”, Machine Vision and Applications,2012; K. M. Yi, K. Yun, S. W. Kim, H. J. Chang, H. Jeong and J. Y. Choi,“Detection of Moving Objects with Non-stationary Cameras in 5.8 ms:Bringing Motion Detection to Your Mobile Device”, Computer Vision andPattern Recognition Workshops (CVPRW), 2013; and J. Kim, X. Wang, H.Wang, C. Zhu and D. Kim, “Fast moving object detection withnon-stationary background”, Multimedia tools and applications, vol. 67,no. 1, 2013. The inventors have observed that also these methods arecomputationally heavy.

Another MCMO method falling in this category is based on Optical Flow(OF) data, which is computationally lighter. Optical flow estimationgives a two-dimensional motion vector (MV), which represents themovement of some points of an image in the following one of thesequence. Essentially, in this approach the optical flow data are usedto calculate a background movement model, which is then subtracted fromthe current frame/image to eliminate global camera movement. In thisway, a modified frame/image is determined which comprises onlyforeground movements, which may be clustered to correctly identifymoving objects. For example, in this context may be cited documents suchas: P. Sadeghi-Tehran, C. Clarke, P. Angelov, “A real-time approach forautonomous detection and tracking of moving objects from UAV”, IEEESymposium on Evolving and Autonomous Learning Systems (EALS), 2014; andJ. Kim, G. Ye and D. Kim, “Moving object detection under free-movingcamera”, Proceedings of IEEE International Conference on ImageProcessing (ICIP), 2010.

SUMMARY

In accordance with an embodiment, a method of detecting a moving objectvia a moving camera includes receiving a sequence of images from themoving camera; generating a set of optical flow data from the sequenceof images, the set of optical flow data comprising motion vectorsassociated with respective features in the sequence of images;determining a global motion model as a function of motion vectors in theset of optical flow data, and, based on the determined global motionmodel, dividing the motion vectors in the set of optical flow data into:an inlier set comprising motion vectors related to global motion, and anoutlier set comprising motion vectors related to local object motion;determining refined parameters of the global motion model as a functionof the motion vectors in the inlier set; receiving a boundary box listdetermined for a previous image in the sequence of images, the boundarybox list comprising a list of boundary boxes, each boundary box defininga position and dimension of a respective moving object in the previousimage; generating a temporally filtered set of optical flow data bydetermining which motion vectors in the set of optical flow data have aposition within at least one of the boundary boxes, and including thedetermined motion vectors are in the temporally filtered set of opticalflow data; calculating for each motion vector in the temporally filteredset of optical flow data, a respective first moto-compensated vector asa function of the refined parameters of the global motion model; andgrouping the respective first moto-compensated vectors as a function ofa position, a length and/or an orientation of the respective firstmoto-compensated vectors, and determining a boundary box list for acurrent image by determining a respective boundary box for each group ofthe respective first moto-compensated vectors. In accordance withanother embodiment, a system comprises a camera; and a processor coupledto the camera, the processor configured to: determine optical flow datafrom a sequence of images provided by the camera, decompose the opticalflow data into global motion related motion vectors and local objectrelated motion vectors, calculate global motion parameters from theglobal motion related motion vectors, calculate moto-compensated vectorsfrom the local object related motion vectors and the calculated globalmotion parameters, compensate the local object related motion vectorsusing the calculated global motion parameters, and cluster thecompensated local object related motion vectors to generate a list ofdetected moving objects.

In accordance with a further embodiment, An image signal processorincludes a hardware image processing core configured to perform opticalflow analysis; and a processor programmed to perform the followingsteps: cause the hardware image processing core to determine opticalflow data from a sequence of images; using a RANSAC algorithm, produce aglobal motion model and an outlier set of motion vectors related tolocal object motion of the sequence of images; motion compensating theoutlier set of motion vectors based on the global motion model toproduce compensated motion vectors; and determining a list of movingobjects from the compensated motion vectors.

In accordance with a further embodiment, a method of detecting movingobjects via a moving camera includes receiving a sequence of images fromthe moving camera; determining optical flow data from the sequence ofimages; decomposing the optical flow data into global motion relatedmotion vectors and local object related motion vectors; calculatingglobal motion parameters from the global motion related motion vectors;calculating moto-compensated vectors from the local object relatedmotion vectors and the calculated global motion parameters; compensatingthe local object related motion vectors using the calculated globalmotion parameters; and clustering the compensated local object relatedmotion vectors to generate a list of detected moving objects.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the present disclosure will now be described withreference to the annexed drawings, which are provided purely by way ofnon-limiting example and in which:

FIG. 1 shows a typical scenario wherein one or more moving objects haveto be detected in an image provided by a moving camera;

FIG. 2 shows an example of a device configured to determine one or moremoving objects in an image provided by a moving camera;

FIG. 3 shows an embodiment of a device configured to determine one ormore moving objects based on optical flow data determined as a functionof a sequence of images provided by a moving camera; and

FIGS. 4 and 5 show details of the operation of the device of FIG. 3.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

In the following description, numerous specific details are given toprovide a thorough understanding of embodiments. The embodiments can bepracticed without one or several specific details, or with othermethods, components, materials, etc. In other instances, well-knownstructures, materials, or operations are not shown or described indetail to avoid obscuring aspects of the embodiments.

Reference throughout this specification to “one embodiment” or “anembodiment” means that a particular feature, structure, orcharacteristic described in connection with the embodiment is includedin at least one embodiment. Thus, the appearances of the phrases “in oneembodiment” or “in an embodiment” in various places throughout thisspecification are not necessarily all referring to the same embodiment.Furthermore, the particular features, structures, or characteristics maybe combined in any suitable manner in one or more embodiments.

The headings provided herein are for convenience only and do notinterpret the scope or meaning of the embodiments.

Various embodiments of the present disclosure are directed to detectingmoving objects via a moving camera. Some embodiments are configured todetermine moving objects, without any assumption about the camera motionand the environmental conditions. Advantageously, some embodiment motiondetection systems and methods have a low-complexity and are executablein real-time.

One or more embodiments of the present disclosure are directed to amethod of detecting moving objects via a moving camera. Some embodimentsare directed to a related processing system, and device, as well as acomputer-program product, loadable into the memory of at least oneprocessor and comprising portions of software code capable ofimplementing the steps of the method when the product is run on at leastone processor. Thus, as used herein, reference to such acomputer-program product is understood to be equivalent to a referenceto a non-transitory computer-readable medium containing instructions forcontrolling the processing system for coordinating implementation of themethod according to the invention. The reference to “at least oneprocessor” is evidently intended to highlight the possibility that thepresent invention is implemented in a modular form and/or distributed.

As mentioned before, various embodiments of the present disclosurerelate to a method and related system for detecting one or more movingobjects via a moving camera. Specifically, in various embodiments, thedetection is based on optical flow data. In various embodiments, thesystem receives thus a sequence of images from the moving camera and thesystem processes the sequence of images in order to generate a set ofoptical flow data comprising a list of motion vectors being associatedwith respective features in the sequence of images. Generally, themotion vectors may thus relate to the movement of the background due tothe camera movement or the movement of objects in the scene, i.e. amovement of the objects with respect to the background.

In various embodiments, the system, e.g. by executing a Random SampleConsensus, RANSAC, determines parameters of a global motion model as afunction of the motion vectors in the set of optical flow data.Specifically, in various embodiments, the parameters of the globalmotion model may comprise a horizontal movement, a vertical movement, arotation and a zoom of the background image due to the movement of thecamera.

In various embodiments, once having selected a given global motion modelthe system may then divide the motion vectors in the set of optical flowdata into an inlier set comprising the motion vectors to which theglobal motion model applies, and an outlier set comprising the motionvectors to which the global motion model does not apply. In variousembodiments, the system determines then refined parameters of the globalmotion model (exclusively) as a function of the motion vectors in theinlier set.

Conversely, the outlier set is processed in order to identify movingobjects in the scene. Specifically, in various embodiments, the objectsare identified via a boundary box list comprising a list of boundaryboxes, each boundary box defining the position and dimension of arespective moving object in the previous image.

In various embodiments, the system may also take into account theboundary box list determined for a previous image, i.e. the system mayreceive a boundary box list determined for a previous image in thesequence of images. For example, in various embodiments, the systemgenerates a temporally filtered set of optical flow data by determiningthe motion vectors in the set of optical flow data having a positionwithin at least one of the boundary boxes, and ensuring that thedetermined motion vectors are included in the outlier set. In variousembodiments, before performing the temporal filtering, the system maycalculate for each motion vector in the outlier set a respectivemoto-compensated vector as a function of the refined parameters, anddetermine a refined set of optical flow data by removing motion vectorsfrom the outlier set which are similar to the respectivemoto-compensated vector, thereby removing motion vectors which likelyshould belong to the inlier set. Thus, the temporally filtered set ofoptical flow data may be generated by ensuring that the determinedmotion vectors are included in the refined set of optical flow data.

In various embodiments, the system may thus calculate for each motionvector in the temporally filtered set of optical flow data a respectivemoto-compensated vector as a function of the refined parameters. Next,the system may group the moto-compensated vectors as a function of theirposition and their length and/or orientation, and determine the boundarybox list for the current image by determining for each group of motionvectors a respective boundary box.

In various embodiments, the system may also pre-process the motionvectors in the set of optical flow data and/or post-process themoto-compensated vectors, wherein the pre-processing and/orpost-processing may comprise removing out-of-range motion vectors,removing out-of-frame motion vectors, and/or eliminating noisy motionvectors.

In various embodiments, the system may also verify whether thetemporally filtered set of optical flow likely contains no data relatedto real object movements. For example, in various embodiments, thesystem may determine the area occupied by the motion vectors in the setof (original) optical flow data and the area occupied by the motionvectors in the temporally filtered set of optical flow data. In fact,when these areas have substantially the same dimension, the temporallyfiltered set of optical flow likely contains only motion vectors relatedto the background movement. Accordingly, the system may set the boundarybox list to empty when the area occupied by the motion vectors in thetemporally filtered set of optical flow data is greater than a givenpercentage of the area occupied by the motion vectors in the set ofoptical flow data. Additionally or alternatively, the system maydetermine the number of motion vectors in the set of optical flow dataand the number of motion vectors in the temporally filtered set ofoptical flow data. In fact, when these numbers are similar, thetemporally filtered set of optical flow likely contains mainly motionvectors related to the background movement. Accordingly, the system mayset the boundary box list to empty when the number motion vectors in thetemporally filtered set of optical flow data is greater than a givenpercentage of the number of motion vectors in the set of optical flowdata.

In the following FIGS. 3 to 5 parts, elements or components which havealready been described with reference to FIGS. 1 to 2 are denoted by thesame references previously used in such Figures; the description of suchpreviously described elements will not be repeated in the following inorder not to overburden the present detailed description.

As mentioned in the foregoing, various embodiments of the presentdisclosure relate to detecting moving objects O by means of a movingcamera 10. Specifically, in various embodiments, the images IMG providedby the one or more cameras 10 are elaborated to extract motion vectors,i.e. the system may determine moving objects (i.e. objects moving withrespect to the (moving) background of the image IMG, e.g. the surface Sshown in FIG. 1) exclusively based on the motion vectors extracted fromthe scene.

FIG. 3 shows an embodiment of a system configured to detect one or moremoving objects O.

As mentioned in the forgoing, such a system comprises at least onecamera 10 suitable to be fixed to a moving device D, such as a UAV, avehicle, etc. Accordingly, in use, the camera 10 will provide a sequenceof images/frames IMG, i.e. a video stream, showing a scene. For example,in various embodiments, the camera 10 may be a STMicroelectronics VG6640image sensor having 1.3 megapixels.

In the embodiment considered, the system comprises also a processingsystem 30 a configured to receive the sequence of images IMG andelaborate the images IMG in order to detect moving objects O.

As mentioned before, in various embodiments, the processing system 30 agenerates the list of moving objects O only based on the images IMG andno further sensors are used. However, in general, the embodiment methodsdisclosed herein may also be combined with other data in order toimprove the detection, such as data providing position and/or movementinformation of the device D.

For example, in various embodiments, the processing system 30 a may beimplemented with an Image Signal Processor (ISP), such as aSTMicroelectronics STV0991 processor. For example, this image processorhas not only a classic pipeline for image reconstruction from a Bayerimage, but includes already hardware image processing cores, e.g. forembedded video analysis, including Optical Flow (OF) and edge dataextraction. More specifically, this processor comprises an embedded ARMCPU, thereby permitting the execution of additional software code forimplementing the complete processing system 30 a within a single imagesignal processor.

In various embodiments, the processing system 30 a comprises twosub-modules.

The first module 302 is configured to analyses the images IMG providedby the camera 10 in order to generate optical flow data OF. For example,in various embodiments, the data OF include a collection/list of MotionVectors (MV) indicating the motion of respective features in the currentimage/frame compared with the previous image/frame. As mentioned before,in various embodiments, the optical flow data OF are computed inhardware, thereby permitting a real time processing with, e.g., 30 fps.Generally, the computation of optical flow data OF, in particular ofmotion vectors, is well known in the art, rendering a more detaileddescription herein unnecessary.

A second module 304 receives the optical flow data OF from the module302 and elaborates the data OF. For example, the module 302 may storethe data OF in a memory, such as a dual-port RAM, and the module 304 mayaccess the same memory locations in order to read the data OF. Forexample, typically, such Motion Vectors comprise bi-dimensional positiondata of the feature (e.g. in terms of pixel coordinates in the currentimage or the previous image) and bi-dimensional displacement data (e.g.in terms of pixel coordinates indicating the difference between theposition of the respective feature in the current image and the previousimage).

Specifically, the module 304 is configured to elaborate the optical flowdata OF in order to determine the list of moving objects O. In variousembodiments, the module 304 is a software module, e.g. executed by meansof the processor, e.g. the processor comprising also the (hardware)module 302.

An embodiment of the operation of the module 304 is shown in FIG. 4.

Substantially, in the embodiment considered, the optical flow data OF,i.e. the motion vectors, are filtered at a step 3042. Specifically, thestep 3042 is used to perform a Global Motion Vector Removal (GMVR) toeliminate global background motion. Accordingly, the step 3042 providesa reduced optical flow set OF7. The obtained optical flow set OF7, i.e.the optical flow data containing only the object movement MVs, is thenused at a clustering step 3044 to obtain a moving object Bounding Box(BB) List BB List for this frame, which essentially comprises the listof moving objects O in the current frame/image IMG. In variousembodiments, the BB List may also be used at the step 3042 for the nextframe for preserving it, thereby avoiding to “lose” moving objectspreviously identified.

FIG. 5 shows an embodiment of the filtering step 3042.

As mentioned before, the step 3042 receives at input the optical flowdata OF determined by the hardware and/or software sub-module 302.Generally, these optical flow data derive from a combination of themovement of the camera 10 and the movement of the objects O in thescene.

In the embodiment considered, the optical flow data OF are firstfiltered by a pre-filtering step 3046. This step is purely optional, butmay be useful in order to eliminate noisy and/or out-of-range motionvectors.

An optimized Random Sample Consensus (RANSAC) is then applied at a step3048 to the filtered optical flow data OF1 provided by the pre-filteringstep 3046 (or directly the original optical flow data OF). Specifically,the step provides two subsets of optical flow data:

an inlier set OF2, which should contain motion vectors related to globalcamera motion; and

an outlier set OF3, which should contain motion vectors related to localobjects motion.

In various embodiments, these two sets of optical flow data OF2 and OF3are then processed independently.

Specifically, the inlier set OF2 is elaborated at a step 3050 torecalculate the parameters of the global motion model of the camera 10,in particular with respect to a horizontal movement Tx and a verticalmovement Ty of the background image due to the movement of the camera,and optionally a rotation a and/or a zoom G of the background image dueto the movement of the camera.

Conversely, the outlier set OF3 is adjusted by a refinement filteringstep 3052, which depending on distance metrics obtains a modifiedoutlier set OF4.

In various embodiments, the modified outlier set OF4 is then provided toa temporal clustering step 3054, which may use the above described BBList in order to avoid that already identified objects are eliminated,i.e., the step 3054 may reintroduce motion vectors in the filteredoutlier set OF4, thereby generating a filtered outlier set OF5.

In various embodiments, the optical flow data OF4 or OF5 are thenprovided to a verification step 3056. Substantially, depending on MVsoccupied area, the verification step 3056 is used to determine whetherthe optical flow data OF4 or OF5 (when also using the temporal filteringstep 3054) can really contain motion vectors related to local objectsmotion. For example, if the verification indicates that certainconditions are not meet (as will be described in greater detail in thefollowing), the optical flow data OF4/OF5 are discarded and the finaloutput OF7 is empty, i.e. no moving objects O are identified in the BBlist for the current frame. Otherwise, in various embodiments, a vectorcompensation is applied at a step 3058 to the optical flow data OF4/OF5,thereby obtaining a compensated outlier set OF6.

In various embodiments, an optional post-filtering step 3060 may beapplied to the compensated outlier set provided by the step 3058. Thus,in this case, the output optical flow data OF7 may correspond to thecompensated outlier set OF6 or the post-filtered optical flow data.

In the following will be described possible embodiments of the varioussteps.

As mentioned before, in various embodiments, the optical flow data OFgenerated by the sub-module 302 are provided to a pre-filtering step3046.

Specifically, in various embodiments, the processing unit 30 a isconfigured to generate at the pre-filtering step 3046 a reduced opticalflow set OF1 by comparing each motion vector of the optical flow set OFwith one or more conditions.

For example, in various embodiments, each motion vector comprisesposition data in the form of absolute pixel coordinates P=(X, Y) where Xcorresponds to the pixel position in a horizontal direction of theprevious image IMG and Y corresponds to the pixel position in a verticaldirection of the previous image IMG, and displacement data in the formof a velocity/displacement vector v=(dX, dY) where dX corresponds to thedisplacement of pixels in the horizontal direction of the current imageIMG with respect to the previous image IMG and dY corresponds to thedisplacement of pixels in the vertical direction of the current imageIMG with respect to the previous image IMG.

For example, in various embodiments, the processing unit 30 a may verifyat the step 3046 whether the displacement data exceed a maximum valueindicative of a maximum object movement, e.g.:ABS(dX)>SEARCH_WIDTH  (1)ABS(dY)>SEARCH_HEIGHT  (2)where the function ABS provides the absolute value, and the parametersSEARCH_WIDTH and SEARCH_HEIGHT represent respective maximum values.Generally, these parameters may be fixed or programmable.

In various embodiments, the processing unit 30 a may verify at the step3046 whether the resulting position of the feature in the current imageIMG, i.e. (X+dX, Y+dY), is within the boundaries of the image IMG. Forexample, assuming that the horizontal position X should be in a rangebetween 0 and IMAGE_WIDTH−1, and the vertical position Y should be in arange between 0 and IMAGE_HEIGHT−1, the processing unit 30 a may verify:(X+dX)<0  (3)(Y+dY)<0  (4)(X+dX)≥IMAGE_WIDTH  (5)(Y+dY)≥IMAGE_HEIGHT  (6)

In various embodiments, the processing unit 30 a may verify at the step3046 whether the motion vector results from noise, which is usually thecase for motion vectors having a rather small displacement. For example,in various embodiment, the processing unit may verify:(ABS(dX)+ABS(dY))≤MAX_N  (7)where the parameter MAX_N represents a minimum requested displacement.Generally, this parameter may be fixed or programmable. For example,typically MAX_N may be in a range between 1 and 5, e.g. 1.

Accordingly, equations (1) and (2) are used to remove out-of-rangemotion vectors, equations (3) to (6) are used to remove out-of-framemotion vectors, and equation (7) eliminates noisy motion vectors. Thus,in the embodiment considered, the respective motion vector is removedwhen at least one of the above conditions is satisfied.

Generally, the pre-processing step 3046 is optional, because the same orsubstantially similar operations may already be performed by thesub-module 302.

In various embodiments, the pre-filtered optical flow data OF1 (ordirectly the optical flow data OF) are then processed at the step 3048,e.g. via a Random Sample Consensus (RANSAC). RANSAC is used to divide anoptical flow data set (OF1 or OF) into two subsets of optical flow dataOF2 and OF3, which contain respectively inliers and outliers MVs. RANSACis per se known, e.g. from M. A. Fischler and R. C. Bolles, “RandomSample Consensus: A Paradigm for Model Fitting with Applications toImage Analysis and Automated Cartography”, Comm. of the ACM, vol. 24, n.11, pp. 381-395, 1981, which is incorporated herein by reference forthis purpose. Substantially, RANSAC randomly samples correspondingmatches and tries to fit them by calculating an error between the restof the samples and the model. It produces a reasonable result only witha certain probability, with this probability increasing as moreiterations are allowed. In this way the best consensus set (e.g. theinlier set) is obtained.

For example, in various embodiments, RANSAC is used to estimate a modelof the movement of the global movement being a function of a horizontalmovement Tx, e.g. in terms of a horizontal pixel displacement, and avertical movement Ty, e.g. in terms of a vertical pixel displacement. Invarious embodiments, the model may also include a rotation α, e.g. anangle with respect to the horizontal direction/axis of the image, and azoom σ.

Thus, in general, also other optimization methods may be used toestimate theses parameters of the global motion model as a function ofthe optical flow data OF/OF1. However, the inventors have observed thatRandom Sample Consensus is very robust and able to estimate parametersof a mathematical model from a set of observed data which containoutliers. For example, when using RANSAC, a number of motion vectors areselected at random and used to calculate the parameters of the model ofthe movement (Tx, Ty, α, σ). The determined model may then be testedagainst all motion vectors in order to determine the number S of samples(motion vectors) for which the model applies. If the number S does not(yet) reach a given threshold N and a given maximum number of cycles isnot yet reached, a new set of motion vectors may be selected at randomand used to construct a new model. Conversely, if the number S reachesthe threshold N, it is selected as model for the global motion. When themaximum number of cycles is reached the last global motion model oralternatively the best matching global motion model (e.g. the model withthe highest number S) may be selected.

In various embodiments, the value N, essentially representing a minimumnumber of sample/motion vectors to which the global motion model has toapply, may be determined as a function of the set OF1.

For example, the inventors have observed that the method described atpages 117-119 of document Hartley R., Zisserman A., “Multiple ViewGeometry in Computer Vision”, Cambridge University Press, SecondEdition, 2004, may also be applied to the problem of motion vectors.Specifically, this document refers to a method for choosing a distancethreshold t, such that with a probability α a point/sample (a motionvector in the present case) is an inlier. Substantially, for eachpoint/motion vector is calculated a distance metric d₁₉₅ ²indicative ofthe distance from the model, and a sample (motion vector in the presentcase) belongs to the inlier set when the distance metric d_(⊥) ²issmaller than t² (see e.g. equation 4.17 of the cited document.Conversely, equation 4.18 of the cited document shows how to calculatethe number N.

Thus, once having obtained the model of movement of the majority ofmotion vectors, i.e. those expectably deriving from the global movementof the camera/background, the motion vectors may be grouped at the step3048 into two subsets of optical flow data:

an inlier set OF2 (i.e., the set of motion vectors to which the globalmotion model applies), which should contain motion vectors related toglobal camera motion; and

an outlier set OF3 (i.e., the set of motion vectors to which the globalmotion model applies), which should contain motion vectors related tolocal objects motion.

Thus, the motion vectors in the inlier set OF2 may be used at the step3050 to calculate refined parameters (Tx,Ty,α,σ) of the global motionmodel. In this respect may be cited the article G. Spampinato, A. Bruna,G. M. Farinella, S. Battiato and G. Puglisi, “Fast and Low PowerConsumption Outliers Removal for Motion Vector Estimation”, Proceedingsof the International Conference on Advanced Concepts for IntelligentVision Systems (ACIVS), 2015, which discloses how the parameters(Tx,Ty,α,σ) of the global motion model may be determined for a set ofmotion vectors from which the outliers have been removed and which isincorporated herein by reference for this purpose. This step essentiallycorresponds to the calculation of the parameters of the global movementmodel at the step 3048, but this time are used only the motion vectorsin the set OF2, instead of randomly selected motion vectors in the setOF1, thereby improving the precision of the parameters of the globalmovement model.

Conversely, the outlier optical flow set OF3 is provided to the step3052 to obtain a reduced outlier optical flow set OF4. In particular, amoto-compensated vector MV′ is calculated for each motion vector MV inthe set OF3. Specifically, the moto-compensated vector MV′ is obtainedby applying to the respective motion vector MV the global motionparameters (Tx,Ty,α,σ).

In various embodiments, the motion vector MV is discarded (removed fromthe set OF3) when both the following two conditions are satisfied:SAD(MV,MV′)<TRESHMV  (8)ABS(β(MV)−β(MV′))<TRESHβ  (9)where the function SAD indicates the Sum of Absolute Difference, thefunction β provides the orientation of the respective motion vectorMV/MV′ (e.g. with respect to the horizontal direction/axis of theimage), and the parameters TRESHMV and TRESHβ correspond to respectivethresholds, which may be fixed or programmable. Substantially, equations(8) and (9) permit to remove motion vectors still relating tobackground/global movement.

In various embodiments, the parameters TRESHMV and TRESHβ are calculatedas percentage of the difference between maximum and minimum orientationlying around the considered MV. For example, considering a given coupleof motion vectors MV/MV′, a given window (e.g., 3×3, 5×3, 3×5, 5×5,etc.) centered in the position of the motion vector MV may be selected.Based on the motion vectors included in this window (except for themotion vector MV), the processing unit 30 a may calculate respectivemoto-compensate motion vectors MV″. Next the processing unit maydetermine the maximum and minimum distance of the motion vectors MV″with respect to the motion vector MV″ and determine the thresholdTRESHMV as a given percentage of the difference between maximum andminimum distances. Similarly, the processing unit 30 a may determine themaximum and minimum angle of the motion vectors MV″ with respect to themotion vector MV′ and determine the threshold TRESHβ as a givenpercentage of the difference between the maximum and minimum angle.

In various embodiments, the modified outlier set OF4 generated at thestep 3052 is then provided to the temporal clustering step 3054.

Substantially, the step 3054 takes as input the outlier refined opticalflow set OF4 and the list of objects O already identified for theprevious frame to obtain a new outlier optical flow set OF5.Specifically, in various embodiments (as will be described in greaterdetail in the following), each object is identified via a boundary box(BB), such as a rectangle having a given position and dimension, e.g.expresses in horizontal and vertical pixels. Thus, in variousembodiments, the objects may be identified by a boundary box list “BBList”.

In various embodiments, the processing unit 30 a may thus preserve atthe step 3054 all motion vectors MV (or the respectivemotion-compensated vectors MV′) of the optical flow set OF1 (with OF1=OFwhen the pre-processing step 3046 is omitted) which are inside of one ofthe boundary boxes determined for the previous frame. For example, thismay be useful to avoid eliminating true object clusters.

The inventors have observed that the step 3054 is rather useful withrespect to motion vectors of clusters/objects exiting the scene. Infact, these motion vectors may easily be confused with motion vectors tobe eliminated due to camera movement. The step 3054 overcomes thisproblem by assuming that objects exiting the scene have been previouslyidentified and stored to the BB List.

Once a final adjusted optical flow data OF5 are obtained, theverification step 3056 is used to determine whether to accept of refusethis set OF5. Substantially, the step 3056 verifies whether the set OF5likely contains just motion vectors resulting from a global movement andthus not related to moving objects.

For example, the inventors have observed that motion vectors of globalmovement/background are more scattered than those of moving objects,i.e. the respective background area is bigger than the area of movingobjects. For example, in various embodiments, the processing unit 30 amay preserve the set OF5 only when the following four conditions aresatisfied:card(OF5)/card(OF1)<TH1  (10)LengthX(OF5)/LengthX(OF1)<TH2  (11)LengthY(OF5)/LengthY(OF1)<TH3  (12)Area(OF5)/Area(OF1)<TH4  (13)with:Area(OF)=LengthX(OF)*LengthY(OF)  (14)where card(OF) is the cardinality of the respective set OF, i.e. thenumber of elements/motion vectors of the respective optical flow set OF,LengthX(OF) and LengthY(OF) are the horizontal and vertical lengths,respectively, occupied by the motion vectors in the respective set OF,i.e. for a set of optical flow data OF comprising motion vectors havingrespective positions P(x,y), the function LengthX(OF) provides thedifference between the maximum horizontal position and the minimumhorizontal position of the motion vectors in the respective set OF, andthe function LengthY(OF) provides the difference between the maximumvertical position and the minimum vertical position of the motionvectors in the respective set OF.

Once a final adjusted optical flow set OF5 passed the verification step3056, the parameters (Tx,Ty,α,σ), obtained at the step 3050 are appliedto the motion vectors in the set OF5, thereby obtaining the a set OF6 ofmoto-compensated motion vectors MV′. Generally, moto-compensated motionvectors MV′ may already be calculated at the step 3052. However, on theone hand the step 3052 may be optional and on the other hand additionalmotion vectors may be added again by the step 3054. Thus, in variousembodiments, the processing unit 30 a may calculate calculated at thestep 3058 moto-compensated vectors MV′ for all motion vectors or onlyfor the motion vectors reintroduced at the step 3054.

Generally, in order to simplify the calculation, in various embodiments,the step 3058 may assume that all objects have the same distance fromthe camera, thus simply applying the parameters (Tx,Ty,α,σ) to eachmotion vector in the set OF5.

In various embodiments, a post-filtering step 3060 may then be appliedto the moto-compensated vectors MV′ in the set OF6 provided by the step3058. For example, in various embodiments, the step 3060 may be used toremove noisy and out-of-range motion vectors. Thus, in variousembodiments the same operations may be performed as at the step 3046,using as input the moto-compensate vectors MV′.

The final set OF7 of moto-compensated vectors is then provided to theclustering step 3044. Specifically, the processing unit 30 a isconfigured to obtain at the step 3044 from the optical flow set OF7 theBB List, which contains the identified moving objects. Substantially,clustering refers to grouping a set of information in such a way thatinformation in the same group (called a cluster) are more similar toeach other than to those in other groups. For example, in the presentapplication moving objects should be identified in the scene by usingonly optical flow data OF7.

For example, motion vectors MV′ apparently belong to the same object ifthey:

a) are spatially near;

b) have a similar velocity, i.e. a similar length; and

c) have a similar orientation.

For example, in various embodiments, two motion vectors MV1 and MV2 atvector positions P1 and P2 and with vector velocities v1 and v2 areconsidered spatially near if:SAD(P1,P2)<MPD  (15)where MPD represents a given threshold, e.g. chosen depending on cameraresolution and precision of optical flow data.

Similarly, in various embodiments, two motion vectors MV1 and MV2 areconsidered to have similar velocity if:SAD(v1,v2)<MVD  (16)where MVD represents a given threshold chosen again as a function of thecamera resolution and the precision of optical flow data.

Finally, in various embodiments, two motion vectors MV1 and MV2 areconsidered to have a similar orientation ifABS(β(V1)−β(V2))<Mβ  (17)where Mβ represents a given threshold.

In various embodiments, the step 3044 assigns the motion vectors MV′ todifferent clusters/objects O based at least two of the above conditionsa) to c). For example, in various embodiments, the step 3044 assigns themotion vectors to different clusters/objects O based on conditions a)and b), and preferably also on condition c).

For example, in various embodiments, the step or block 3044 may use theclustering method described in Italian patent applicationIT102015000082886 or G. Spampinato, A. Bruna, S. Curti, and V. D'Alto,“Advanced Low Cost Clustering System”, 6th International Conference onImage Processing Theory, Tools and Applications (IPTA), 2016, which areincorporated herein by reference.

Thus, once having identified similar motion vectors, the processing unit30 a may determine at the step 3044 an area, e.g. in the form of arectangle, enclosing the respective motion vectors, which represents theboundary box associated with a given object. Finally, the obtainedboundary boxes may be stored to the BB List, which identifies thusmoving objects in the scene.

Thus, in one or more of the previous embodiments, the optionalpre-filtering and/or post-filtering steps 3046 and 3060 are used toremove out-of-range, out-of-frame and/or noisy motion vectors (in theset OF) or motion-compensated vectors (in the set OF6). The RANSAC step3048 is used to obtain a “best” consensus motion vector set(corresponding to the inlier set OF2) and the remaining motion vectorsmay be considered as outliers (corresponding to the outlier set OF3).The inlier set OF2 is used at the step 3050 to estimate a global motionmodel, which may comprise parameters related to shift/displacement (Tx,Ty), rotation (α), and zoom (σ). Conversely, a refinement filter mayoptionally be applied at the step 3052 to the outlier set OF3, whichpermits to remove/discard motion vectors which are similar to therespective moto-compensated vector. In various embodiments, a temporalfiltering may be performed at the step 3054 in order topreserve/reintroduce motion vectors inside previous calculated boundaryboxes. The verification step 3056 permits to verifying whether theremaining motion vectors presumably do not relate to moving objects,e.g. because the remaining motion vectors are few and/or their area issmall. In various embodiments, the parameters of the global movement maybe applied at a step 3058 to the remaining motion vectors, therebyobtaining the final moto-compensated set, which may be used to identifymoving objects via a clustering step 3044, wherein with each movingobject may be associated a respective boundary box.

Embodiment motion detection systems and methods have been tested withdifferent scenarios and different cameras at different resolutions, withboth linear and fish-eye lens, obtaining good results in terms of movingobject identification. The tests show that some embodiments of thepresent invention advantageously provide a very reliable,computationally efficient, and low-cost IMO detection system for MCMO,which makes use of only optical flow data of two consecutive frames. Dueto its simplicity, embodiments of the present invention may be used alsofor low power applications. Moreover, the proposed system is veryflexible and may be used, e.g. with other methods for motion estimationat the module 302 or clustering at the step 3044.

Advantages of embodiments include the ability to detect independentlymoving objects in the context of a moving camera moving object (MCMO)environment in a computationally efficient manner.

Of course, without prejudice to the principle of the invention, thedetails of construction and the embodiments may vary widely with respectto what has been described and illustrated herein purely by way ofexample, without thereby departing from the scope of the presentinvention, as defined by the ensuing claims. For example, instead ofusing a SAD in the above equations, also other distance metrics may beused, such as the Euclidean distance, etc.

While this invention has been described with reference to illustrativeembodiments, this description is not intended to be construed in alimiting sense. Various modifications and combinations of theillustrative embodiments, as well as other embodiments of the invention,will be apparent to persons skilled in the art upon reference to thedescription. It is therefore intended that the appended claims encompassany such modifications or embodiments.

What is claimed is:
 1. A method of detecting a moving object via amoving camera, the method comprising: receiving a sequence of imagesfrom the moving camera; generating a set of optical flow data from thesequence of images, the set of optical flow data comprising motionvectors associated with respective features in the sequence of images;determining a global motion model as a function of motion vectors in theset of optical flow data, and, based on the determined global motionmodel, dividing the motion vectors in the set of optical flow data into:an inlier set comprising motion vectors related to global motion, and anoutlier set comprising motion vectors related to local object motion;determining refined parameters of the global motion model as a functionof the motion vectors in the inlier set; receiving a boundary box listdetermined for a previous image in the sequence of images, the boundarybox list comprising a list of boundary boxes, each boundary box defininga position and dimension of a respective moving object in the previousimage; generating a temporally filtered set of optical flow data bydetermining which motion vectors in the set of optical flow data have aposition within at least one of the boundary boxes, and including thedetermined motion vectors are in the temporally filtered set of opticalflow data; calculating for each motion vector in the temporally filteredset of optical flow data, a respective first moto-compensated vector asa function of the refined parameters of the global motion model; andgrouping the respective first moto-compensated vectors as a function ofa position, a length and/or an orientation of the respective firstmoto-compensated vectors, and determining a boundary box list for acurrent image by determining a respective boundary box for each group ofthe respective first moto-compensated vectors.
 2. The method accordingto claim 1, wherein refined parameters of the global motion modelcomprise: a horizontal movement of a background image due to a movementof the camera, a vertical movement of the background image due to themovement of the camera, a rotation of the background image due to themovement of the camera; and a zoom of the background image due to themovement of the camera.
 3. The method according to claim 1, wherein theglobal motion model is determined by performing a Random SampleConsensus (RANSAC).
 4. The method according to claim 1, furthercomprising: calculating for each motion vector in the outlier set, arespective second moto-compensated vector as a function of the refinedparameters; and before generating the temporally filtered set of opticalflow data, removing motion vectors from the outlier set similar to therespective second moto-compensated vector to produce a refined set ofoptical flow data, wherein the temporally filtered set of optical flowdata is generated from the refined set of optical flow data.
 5. Themethod according claim 1, further comprising pre-processing the motionvectors in the set of optical flow data, wherein the pre-processingcomprises at least one of: removing out-of-range motion vectors;removing out-of-frame motion vectors; or eliminating noisy motionvectors.
 6. The method according claim 1, further comprisingpost-processing the moto-compensated vectors, wherein thepost-processing comprises at least one of: removing out-of-rangemoto-compensated vectors; removing out-of-frame moto-compensatedvectors; or eliminating noisy moto-compensated vectors.
 7. The method ofclaim 1, wherein generating the set of optical flow data comprises usingimage data from only two consecutive frames.
 8. A non-transitory machinereadable medium having stored thereon a program having a program codefor performing the method of claim 1, when the program is executed on atleast one processor.
 9. The method according to claim 1, comprisingdetermining an area occupied by the motion vectors in the set of opticalflow data and an area occupied by the motion vectors in the temporallyfiltered set of optical flow data, and setting the boundary box list toempty when the area occupied by the motion vectors in the temporallyfiltered set of optical flow data is greater than a given percentage ofthe area occupied by the motion vectors in the set of optical flow data.10. The method according to claim 9, further comprising determining anumber of motion vectors in the set of optical flow data and a number ofmotion vectors in the temporally filtered set of optical flow data, andsetting the boundary box list to empty when the number motion vectors inthe temporally filtered set of optical flow data is greater than a givenpercentage of the number of motion vectors in the set of optical flowdata.
 11. A system comprising: a camera; and a processor coupled to thecamera, the processor configured to: determine optical flow data from asequence of images provided by the camera, decompose the optical flowdata into global motion related motion vectors and local object relatedmotion vectors, calculate global motion parameters from the globalmotion related motion vectors, calculate moto-compensated vectors fromthe local object related motion vectors and the calculated global motionparameters, compensate the local object related motion vectors using thecalculated global motion parameters, and cluster the compensated localobject related motion vectors to generate a list of detected movingobjects.
 12. The system of claim 11, wherein the processor comprises animage signal processor.
 13. The system of claim 11, wherein the list ofdetected moving objects comprises a bounding box list.
 14. The system ofclaim 11, wherein the camera is attached to a moving device.
 15. Thesystem of claim 14, wherein the moving device is a vehicle.
 16. An imagesignal processor comprising: a hardware image processing core configuredto perform optical flow analysis; and a processor programmed to performthe following steps: causing the hardware image processing core todetermine optical flow data from a sequence of images; using a RANSACalgorithm, produce a global motion model and an outlier set of motionvectors related to local object motion of the sequence of images; motioncompensating the outlier set of motion vectors based on the globalmotion model to produce compensated motion vectors; and determining alist of moving objects from the compensated motion vectors.
 17. Theimage signal processor of claim 16, wherein the sequence of images isgenerated by a moving camera.
 18. The image signal processor of claim16, wherein the processor is configured to cause the hardware imageprocessing core to determine the optical flow data from only twoconsecutive images.
 19. The image signal processor of claim 16, whereinthe processor is further programmed to motion compensate the outlier setof motion vectors by: generating an inlier set of motion vectors relatedto global motion of the sequence of images using the RANSAC algorithm;determining refined global motion parameters based on the inlier set ofmotion vectors; and compensating the outlier set of motion vectors basedon the refined global motion parameters.
 20. The image signal processorof claim 19, wherein the processor is further programmed to removemotion vectors from the outlier set of motion vectors that are similarto the compensated motion vectors.
 21. A method of detecting movingobjects via a moving camera, the method comprising: receiving a sequenceof images from the moving camera; determining optical flow data from thesequence of images; decomposing the optical flow data into global motionrelated motion vectors and local object related motion vectors;calculating global motion parameters from the global motion relatedmotion vectors; calculating moto-compensated vectors from the localobject related motion vectors and the calculated global motionparameters; compensating the local object related motion vectors usingthe calculated global motion parameters; and clustering the compensatedlocal object related motion vectors to generate a list of detectedmoving objects.